home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / ufo_comm.swf / scripts / frame_144 / DoAction.as
Encoding:
Text File  |  2007-04-25  |  7.3 KB  |  216 lines

  1. var ┬º\x01┬º = 671;
  2. while(true)
  3. {
  4.    if(eval("\x01") == 671)
  5.    {
  6.       set("\x01",eval("\x01") + 75);
  7.       ┬º┬ºpush(true);
  8.    }
  9.    else
  10.    {
  11.       if(eval("\x01") == 942)
  12.       {
  13.          set("\x01",eval("\x01") - 931);
  14.          break;
  15.       }
  16.       if(eval("\x01") != 746)
  17.       {
  18.          if(eval("\x01") == 11)
  19.          {
  20.             set("\x01",eval("\x01") + 932);
  21.             _root.level = 2;
  22.             _root.primaData = true;
  23.             _root.ufo.swapDepths(999);
  24.             _root.life = 100;
  25.             _root.lifeBar.gotoAndStop(_root.life);
  26.             _root.lifeText = _root.life + "%";
  27.             _root.oiRapite = 0;
  28.             _root.smokeDepth = 500;
  29.             _root.speedX = 0;
  30.             _root.speedY = 0.7;
  31.             _root.accel = 1;
  32.             _root.counterPozitii = 0;
  33.             _root.beamCounter = 0;
  34.             _root.beamOpen = false;
  35.             _root.rotation = false;
  36.             _root.float = false;
  37.             h = 1;
  38.             while(h <= 4)
  39.             {
  40.                _root.attachMovie("rosu" + h,"rosu" + h,_root.getNextHighestDepth());
  41.                _root["rosu" + h]._alpha = 0;
  42.                h++;
  43.             }
  44.             _root.onEnterFrame = function()
  45.             {
  46.                if(ok)
  47.                {
  48.                   _root.lifeText = _root.life + "%";
  49.                   _root.ufo._x += _root.speedX;
  50.                   _root.ufo._y += _root.speedY;
  51.                   _root.rotatie = _root.ufo._rotation;
  52.                   if(Key.isDown(37))
  53.                   {
  54.                      _root.rotation = false;
  55.                      if(_root.speedX > -3)
  56.                      {
  57.                         if(_root.counterPozitii == 0)
  58.                         {
  59.                            _root.ufo.ufo2.ufo3.gotoAndPlay("apasatS");
  60.                         }
  61.                         _root.counterPozitii = 1;
  62.                         _root.speedX -= _root.accel;
  63.                         if(!_root.beamOpen && _root.ufo._rotation > -12)
  64.                         {
  65.                            _root.ufo._rotation -= 1;
  66.                         }
  67.                      }
  68.                   }
  69.                   if(Key.isDown(39))
  70.                   {
  71.                      _root.rotation = false;
  72.                      if(_root.speedX < 3)
  73.                      {
  74.                         if(_root.counterPozitii == 0)
  75.                         {
  76.                            _root.ufo.ufo2.ufo3.gotoAndPlay("apasatD");
  77.                         }
  78.                         _root.counterPozitii = 1;
  79.                         _root.speedX += _root.accel;
  80.                         if(_root.beamOpen == false && _root.ufo._rotation < 12)
  81.                         {
  82.                            _root.ufo._rotation += 1;
  83.                         }
  84.                      }
  85.                   }
  86.                   if(Key.isDown(38))
  87.                   {
  88.                      if(_root.speedY > -3)
  89.                      {
  90.                         if(_root.counterPozitii == 0)
  91.                         {
  92.                            _root.ufo.ufo2.ufo3.gotoAndPlay("apasatSus");
  93.                         }
  94.                         _root.counterPozitii = 1;
  95.                         _root.speedY -= _root.accel;
  96.                      }
  97.                   }
  98.                   if(Key.isDown(40))
  99.                   {
  100.                      if(_root.speedY < 3)
  101.                      {
  102.                         if(_root.counterPozitii == 0)
  103.                         {
  104.                            _root.ufo.ufo2.ufo3.gotoAndPlay("apasatJos");
  105.                         }
  106.                         _root.counterPozitii = 1;
  107.                         _root.speedY += _root.accel;
  108.                      }
  109.                   }
  110.                   if(Key.isDown(32))
  111.                   {
  112.                      if(_root.ufo._rotation == 0)
  113.                      {
  114.                         if(_root.beamCounter == 0)
  115.                         {
  116.                            _root.ufo.raza.gotoAndPlay(2);
  117.                            _root.beamCounter = 1;
  118.                         }
  119.                      }
  120.                   }
  121.                   if(_root.speedX < 0)
  122.                   {
  123.                      if(_root.ufo._rotation < 0 && _root.rotation == true)
  124.                      {
  125.                         _root.ufo._rotation = _root.ufo._rotation + 1;
  126.                      }
  127.                      _root.speedX += 0.2;
  128.                      if(_root.speedX >= 0)
  129.                      {
  130.                         _root.speedX = 0;
  131.                         _root.ufo.ufo2.ufo3.gotoAndStop(1);
  132.                         _root.ufo._rotation = 0;
  133.                      }
  134.                   }
  135.                   if(_root.speedX > 0)
  136.                   {
  137.                      if(_root.ufo._rotation > 0 && _root.rotation == true)
  138.                      {
  139.                         _root.ufo._rotation--;
  140.                      }
  141.                      _root.speedX -= 0.2;
  142.                      if(_root.speedX <= 0)
  143.                      {
  144.                         _root.speedX = 0;
  145.                         _root.ufo.ufo2.ufo3.gotoAndStop(1);
  146.                         _root.ufo._rotation = 0;
  147.                      }
  148.                   }
  149.                   if(_root.speedY < 0)
  150.                   {
  151.                      _root.speedY += 0.2;
  152.                      if(_root.speedY >= 0)
  153.                      {
  154.                         _root.speedY = 0.7;
  155.                      }
  156.                   }
  157.                }
  158.                else
  159.                {
  160.                   _root.ufo._y -= 5;
  161.                   _root.ufo._alpha -= 5;
  162.                }
  163.             };
  164.             if(_root.primaData)
  165.             {
  166.                _root.attachMovie("d" + _root.level,"d" + _root.level,93);
  167.             }
  168.             _root.d1._x = 405;
  169.             _root.d1._y = 257;
  170.             _root["d" + _root.level]._x = 264;
  171.             _root["d" + _root.level]._y = 238;
  172.             _root.removeArray = new Array();
  173.             _root.removeArray = ["o1","o2","o3","o4","bomb","bomb2","bomb3","ufo","brat","poarta"];
  174.             _root.semneArray = new Array();
  175.             _root.semneArray = ["!","?","*","#"];
  176.             _root.starArray = new Array();
  177.             _root.starArray = ["s4","s4","s4","s4"];
  178.             listener = new Object();
  179.             listener.onKeyUp = function()
  180.             {
  181.                if(Key.getCode() == 37 || Key.getCode() == 38 || Key.getCode() == 39 || Key.getCode() == 40)
  182.                {
  183.                   _root.ufo.ufo2.ufo3.play();
  184.                   _root.counterPozitii = 0;
  185.                   _root.rotation = true;
  186.                }
  187.                if(Key.getCode() == 32)
  188.                {
  189.                   _root.ufo.raza.play();
  190.                }
  191.             };
  192.             Key.addListener(listener);
  193.             _root.oiCounter = 30;
  194.             _root.bombCounter = 20;
  195.             _root.smokeCounter = 3500;
  196.             _root.starCounter = 3000;
  197.             _root.oiTarget = 2;
  198.             _root.oiPeScena = 2;
  199.             _root.bombe = 3;
  200.             stop();
  201.             break;
  202.          }
  203.          if(eval("\x01") == 943)
  204.          {
  205.             set("\x01",eval("\x01") - 943);
  206.          }
  207.          break;
  208.       }
  209.       set("\x01",eval("\x01") + 196);
  210.       if(┬º┬ºpop())
  211.       {
  212.          set("\x01",eval("\x01") - 931);
  213.       }
  214.    }
  215. }
  216.